<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('工资信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
	<div class="row">
		<div class="col-sm-12 search-collapse">
			<form id="formId">
				<div class="select-list">
					<ul>

						<li>
							<label>涨薪/扣薪：</label>
							<select name="status" th:with="type=${@dict.getType('money_up_or_down')}">
								<option value="">所有</option>
								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
							</select>
						</li>

						<li>
							<label>时间：</label>
							<input type="text" class="time-input" placeholder="请选择时间" name="time"/>
						</li>
					</ul>
				</div>
			</form>
			<button class="btn btn-primary" onclick="search()"><i class="fa fa-search"></i> 搜索</button>
			<a class="btn btn-warning" onclick="$.table.exportExcel()" >
				<i class="fa fa-download"></i> 导出
			</a>
		</div>

		<div class="col-sm-12  table-striped">
			<div class="table-responsive m-t" >
				<table class="table invoice-table">
					<thead>
					<tr>
						<th>涨薪扣薪</th>
						<th>金额</th>
						<th>时间</th>
						<th>金额对应信息</th>
						<th>金额类型</th>
					</tr>
					</thead>
					<tbody id="mytable">

					</tbody>
				</table>
			</div>
			<!-- /table-responsive -->

			<table class="table invoice-total">
				<tbody id="zong">

				</tbody>
			</table>
			<div class="text-right hidden-print">
				<button class="btn btn-primary" onclick="printPage()"><i class="fa fa-print"></i> 申诉</button>
				<button class="btn btn-primary" onclick="baoxiaoPage()"><i class="fa fa-print"></i> 报销</button>
			</div>
		</div>


	</div>

</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
	var editFlag = [[${@permission.hasPermi('system:wages:edit')}]];
	var removeFlag = [[${@permission.hasPermi('system:wages:remove')}]];
	var statusDatas = [[${@dict.getType('zxhkx')}]];
	var prefix = ctx + "system/wages";
	var url= prefix + "/list1";

	$(function() {
				search();

			}
	);
	function printPage() {
		$.modal.open("添加申诉","/system/config/add1")
	}
	function baoxiaoPage() {
		$.modal.open("报销","/system/config/add2")
	}
	function search() {
		var da = $('#formId').serialize()
		console.log(da)
		$.post( url,da,function(data,status){
			if(data.tatol>0){

			}
			data.rows.forEach(addfarm)
			$("#mytable").append("\t<tr>\n" +
					"\t\t\t\t\t<td><strong>基本工资：</strong>\n" +
					"\t\t\t\t\t</td>\n" +
					"\t\t\t\t\t<td>&yen;"+data.old+"</td>\n" +
					"\t\t\t\t</tr>\n" +
					"\t\t\t\t<tr>\n" +

					"\t\t\t\t\t<td><strong>实际应发</strong>\n" +
					"\t\t\t\t\t</td>\n" +
					"\t\t\t\t\t<td>&yen;"+data.wages+"</td>\n" +
					"\t\t\t\t</tr>")

		});
	}
	function addfarm(a) {
		var id = a.id;
		var sta ;
		if(a.status=="Y"){
			sta="加薪";
		}else {
			sta="扣薪"
		}
		var gain;
		if(!a.gain){
			gain=0
		}
		gain = a.monkey

		$("#mytable").append(
				"<tr>\n" +
				"\t\t\t\t\t\t<td>\n" +
				"\t\t\t\t\t\t\t<div><strong>"+sta+"</strong>\n" +
				"\t\t\t\t\t\t\t</div>\n" +
				"\t\t\t\t\t\t</td>\n" +
				"\t\t\t\t\t\t<td>&yen;"+gain+"</td>\n" +
				"\t\t\t\t\t\t<td>"+a.time+"</td>\n" +
				"\t\t\t\t\t\t<td>"+a.msg+"</td>\n" +
				"\t\t\t\t\t\t<td>"+a.wtype+"</td>\n" +
				"\t\t\t\t\t</tr>\n" +
				"\t\t\t\t\t<tr>\n" +
				"\t\t\t\t\t\t<td>\n" )
	}
</script>
</body>
</html>
